<template>
  <div style="height: 98vh">
    <model-index :http="http" v-if="uuid" :uuid="uuid" @initOk="initOk">
    </model-index>
  </div>
</template>

<script>
import http from "@/utils/http/httpUtil";
import ModelIndex from "@/components/table/model/model-index.vue";
import {mapActions, mapGetters} from "vuex";
export default {
  provide() {
    return {
      http: http,
      tableAll: this.table
    }
  },
  name: 'App',
  data() {
    return {
      form:{
        date:[],
      },
      uuids:'1897537110076866560',
      uuid: '1926915868976558080',
      treeUuid: '1815551679408418816',
      table: {
        t1:{}
      },
      http: http,
      formConfig: undefined,
    }
  },
  computed: {
    ...mapGetters('dict', ['val']),
    ...mapGetters('dictType', {dictTypeVal: 'val'})
  },
  methods:{
    initOk({formConfig}){
      setTimeout(()=>{
        console.log(this.table,formConfig)
      },1000)
    },
    ...mapActions('dict', {dictRefresh: 'refresh'}),
    ...mapActions('dictType', {dictTypeRefresh: 'refresh'}),
  },
  components: {ModelIndex
  },
  created() {
    this.dictRefresh()
    this.dictTypeRefresh()
    // 假设 o 是包含 valueSEARCHToOtherProp 属性的对象
    const o = {
      valueSEARCHToOtherProp: "(function() {const now = new Date(); const firstDay = new Date(now.getFullYear(), now.getMonth(), 1);" +
          "const lastDay = new Date(now.getFullYear(), now.getMonth() + 1, 0); " +
          "const formatDate = (date) => {const year = date.getFullYear(); const month = String(date.getMonth() + 1).padStart(2, '0');" +
          " const day = String(date.getDate()).padStart(2, '0'); return year+'-'+month+'-'+day; }; return [formatDate(firstDay), formatDate(lastDay)]; })()"
    };
    let aa = eval(o.valueSEARCHToOtherProp)
    console.log(aa)
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
